package com.tongcao.cn.validator.abstracts;

/**
 * @Author:tongcao
 * @Date:2019/4/26 15:23
 * Description:由继承类实现验证规则，返回true为验证通过。返回false为验证失败！
 */
public abstract class ValidatorAdapter implements Validator {

    private String message = "default validator error message!";

    private String errorCode = "DEFAULT_VALIDATOR";

    @Override
    public boolean validate(Object object) {
        return true;
    }

    @Override
    public boolean validate(Object object, double[] v) {
        return true;
    }

    @Override
    public boolean validate(Object object, Class<?> clazz) {
        return true;
    }

    @Override
    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    @Override
    public String getErrorCode() {
        return errorCode;
    }
}